package com.csun.cmny.provider.service.impl;

import com.csun.cmny.core.support.BaseService;
import com.csun.cmny.provider.dao.DmcAppSleepRangeRecordMapper;
import com.csun.cmny.provider.model.domain.DmcAppSleepRangeRecord;
import com.csun.cmny.provider.model.dto.app.AppSleepDateQueryDto;
import com.csun.cmny.provider.model.vo.app.AppSingleDaySleepDataVo;
import com.csun.cmny.provider.service.DmcAppSleepRangeRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
@Transactional
public class DmcAppSleepRangeRecordServiceImpl extends BaseService<DmcAppSleepRangeRecord> implements DmcAppSleepRangeRecordService {

    @Resource
    private DmcAppSleepRangeRecordMapper dmcAppSleepRangeRecordMapper;

    @Override
    public List<DmcAppSleepRangeRecord> getSleepRangesByDeviceIdAndDate(AppSleepDateQueryDto appSleepDateQueryDto) {

        DmcAppSleepRangeRecord rangeQuery = new DmcAppSleepRangeRecord();
        rangeQuery.setDeviceId(appSleepDateQueryDto.getDeviceId());
        rangeQuery.setDate(appSleepDateQueryDto.getDate());
        return select(rangeQuery);
    }
}
